﻿using SBlogCore.Common.FluentValidatorExtend;

namespace SBlogCore.WebAdminApplication.SysUserManager.Dto
{
    public class SysUserInfoEditInput: SysUserInfoInput
    {
        /// <summary>
        /// ID
        /// </summary>
        public long? Id { get; set; }
    }

    public class SysUserInfoInput
    {
        
        /// <summary>
        /// 用户名字
        /// </summary>
        public string? UserName { get; set; }
        /// <summary>
        /// 用户年龄
        /// </summary>
        public int? Age { get; set; }
        /// <summary>
        /// 用户年龄
        /// </summary>
        public int? Sex { get; set; }
        /// <summary>
        /// 账号
        /// </summary>
        public string? Account { get; set; }
        /// <summary>
        /// 电话
        /// </summary>
        public string? Phone { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        public string? Email { get; set; }

        /// <summary>
        /// 生日
        /// </summary>
        public string? Birthday { get; set; }

        /// <summary>
        /// 照片
        /// </summary>
        public long? PhotoId { get; set; }

        /// <summary>
        /// 标签
        /// </summary>
        public string? Tag { get; set; }
        public long? SysOrgId { get; set; }
    }
    public class SysUserInfoInputValidator : SblogCoreAbstractValidator<SysUserInfoInput>
    {
        public SysUserInfoInputValidator()
        {
            RuleFor(x => x.UserName).NotNull().WithMessage("用户名不能为空");
            RuleFor(x => x.Age).NotNull().WithMessage("年龄不能为空");
            RuleFor(x => x.Sex).NotNull().WithMessage("性别不能为空");
            RuleFor(x => x.Account).NotNull().WithMessage("账号不能为空");
        }
    }
    public class SysUserInfoEditInputValidator : SblogCoreAbstractValidator<SysUserInfoEditInput>
    {
        public SysUserInfoEditInputValidator()
        {
            RuleFor(x => x.UserName).NotNull().WithMessage("用户名不能为空");
            RuleFor(x => x.Id).NotNull().WithMessage("ID不能为空");
            RuleFor(x => x.Age).NotNull().WithMessage("年龄不能为空");
            RuleFor(x => x.Sex).NotNull().WithMessage("性别不能为空");
            RuleFor(x => x.Account).NotNull().WithMessage("账号不能为空");
        }
    }
}
